package com.fizzkai.p2p.bussness.service.impl;

import com.fizzkai.p2p.bussness.domain.PaymentScheduleDetail;
import com.fizzkai.p2p.bussness.mapper.PaymentScheduleDetailMapper;
import com.fizzkai.p2p.bussness.service.IPaymentScheduleDetailService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.Date;

@Service@Transactional
public class PaymentScheduleDetailServiceImpl implements IPaymentScheduleDetailService {

    @Autowired
    private PaymentScheduleDetailMapper detailMapper;

    @Override
    public int save(PaymentScheduleDetail entity) {
        return detailMapper.insert(entity);
    }

    @Override
    public int update(PaymentScheduleDetail entity) {
        return detailMapper.updateByPrimaryKey(entity);
    }

    @Override
    public PaymentScheduleDetail get(Long id) {
        return detailMapper.selectByPrimaryKey(id);
    }

    @Override
    public void updatePayDate(Long id, Date now) {
        detailMapper.updatePayDateByPaymentScheduleId(id, now);
    }

}
